package com.example.mp.core.exceptions;

import lombok.Data;

/**
 * 程序自定义异常
 */
@Data
public class DefinitionException extends RuntimeException {

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误信息
     */
    private String exceptionMsg;

    public DefinitionException(ExceptionEnum exceptionEnum) {
        this.code = exceptionEnum.getCode();
        this.exceptionMsg = exceptionEnum.getMessage();
    }
}
